#ifndef SRC_BASE_STRING_UTIL_H_
#define SRC_BASE_STRING_UTIL_H_

#include <string>
#include <vector>
#include <sstream>

const char LOWERCASE[] = "abcdefghijkrmnopqlstuvwxyz";
const char UPPERCASE[] = "ABCDEFGHIJKRMNOPQLSTUVWXYZ";
const char DIGIT[] = "0123456789";
const char LETTER[] = "abcdefghijkrmnopqlstuvwxyzABCDEFGHIJKRMNOPQLSTUVWXYZ";
const char LOWERCASE_DIGIT[] = "abcdefghijkrmnopqlstuvwxyz0123456789";
const char UPPERCASE_DIGIT[] = "ABCDEFGHIJKRMNOPQLSTUVWXYZ0123456789";
const char LETTER_DIGIT[] =
  "abcdefghijkrmnopqlstuvwxyzABCDEFGHIJKRMNOPQLSTUVWXYZ0123456789";

std::string& Trimmed(std::string &str);

std::string Format(char const* format, ...);

std::vector<std::string> Split(const std::string &str,
                               const std::string &delim);

std::string ToLower(const std::string &str);

std::string ToUpper(const std::string &str);

template <typename T>
inline T Convert(const std::string &str) {
  std::istringstream iss(str);
  T t;
  iss >> t;
  return t;
}

std::string RandomString(std::size_t size, const char* chars);

#endif  // SRC_BASE_STRING_UTIL_H_
